<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib uri="/tld/dictionary" prefix="dictionary"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>订单详细</title>
<link rel="stylesheet" href="${ctx}/static/css/style.css" type="text/css" /> 
<link rel="stylesheet" href="${ctx}/static/css/style1.css" type="text/css" /> 
<link rel="stylesheet" href="${ctx}/static/css/kongjian.css" type="text/css" /> 
<link rel="stylesheet" href="${ctx}/static/css/jquery.ui.all.css" />
<script src="${ctx}/static/script/jquery-1.4.min.js" type="text/javascript"></script>
<script src="${ctx}/static/script/jquery.ui.core.js"></script>
<script src="${ctx}/static/script/jquery.ui.datepicker.js"></script>
<script src="${ctx}/static/script/jsCoreUtil.js"></script>
</head>

<body style="margin:10px;">
<form:form id="mainForm" action="${ctx}/recommend/recommend_detail" modelAttribute="recommendInfoForm" method="post" onSubmit="doSubmit();return false;">
<input type="hidden" name="pageNo" id="pageNo" value="${page.pageNo}"/>
<input type="hidden" name="id" id="id" value="${recommendInfoForm.id}"/>
<input type="hidden" name="orderId" id="orderId" value="${recommendInfoForm.orderId}"/>
	<div>
		<p style=" text-align:left; height:30px; margin:0 20px; padding:0 10px; line-height:30px; border:#3b97e4 solid 1px;">
		订单编号：${recommendInfoForm.orderId}
		投资编号：${recommendInfoForm.investInfo.id}
		客户编号：${recommendInfoForm.investInfo.customerInfo.customerCode}
		客户姓名：${recommendInfoForm.investInfo.customerInfo.cnName}
		推荐对价金额：<fmt:formatNumber value="${recommendInfoForm.recommendAmt}" pattern="##,###.##" />
		约定交割日期：
		<c:if test="${recommendInfoForm.investInfo.regularType=='00130001'}">
			<fmt:formatDate value="${recommendInfoForm.investInfo.investStartDate}"   pattern="yyyy-MM-dd" type="date" dateStyle="long" />
		</c:if>
		<c:if test="${recommendInfoForm.investInfo.regularType=='00130002'}">
			<fmt:formatDate value="${recommendInfoForm.investInfo.regularStartDate}"   pattern="yyyy-MM-dd" type="date" dateStyle="long" />
		</c:if>
    </div>
	<div class="shenqing2">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
	      <tr>
            <td width="61">债权编号：</td>
            <td width="150px" style="color:#2E74D1;"><input type="text" id="loanId" name="loanId" class="ggkj_inputtext_80" value="${recommendInfoForm.loanId}" /></td>
            <td width="85">债务人：</td>
            <td width="150px" style="color:#2E74D1;"><input type="text" id="loanCustomerName" name="loanCustomerName" class="ggkj_inputtext_80" value="${recommendInfoForm.loanCustomerName}" />
            </td>
			<td width="85">收益率：</td>
            <td width="250px" style="color:#2E74D1;">
             	<input type="text" id="irrMin" name="irrMin" value="${recommendInfoForm.irrMin}"  class="ggkj_inputtext_80" value="10%" />-
             	<input type="text" id="irrMax" name="irrMax" value="${recommendInfoForm.irrMax}"  class="ggkj_inputtext_80" value="10%" />
           </td>
			<td width="85">借款产品：</td>
            <td width="150px" style="color:#2E74D1;">
             <select id="product"  name="product">
             <option value="" selected="true">请选择</option>
             <option value="1001" <c:if test="${recommendInfoForm.product=='1001'}">selected="true" </c:if> >随房贷</option>
	         <option value="1002" <c:if test="${recommendInfoForm.product=='1002'}">selected="true" </c:if>>随意贷</option>
	         <option value="1003" <c:if test="${recommendInfoForm.product=='1003'}">selected="true" </c:if>>随薪贷</option>
	         <option value="1004" <c:if test="${recommendInfoForm.product=='1004'}">selected="true" </c:if>>随车贷</option>
	         <option value="1005" <c:if test="${recommendInfoForm.product=='1005'}">selected="true" </c:if>>其他</option>   	
				</select>
            </td>
			 <td width="93"><input name="Input" type="submit" class="chaxun_btn" value="&nbsp;&nbsp;查询" />
             </td>
          </tr>
      </table>
    </div>
	<div class="yiban">
	<table style="width:100%;" class="ggkj_table"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <th scope="col">序号</th>
    <th scope="col">债权编号</th>
    <th scope="col">债务人</th>
    <th scope="col">债权人</th>
    <th scope="col">债务本金</th>
    <th scope="col">还款期数</th>
    <th scope="col">债权终止日期</th>
    <th scope="col">剩余期数</th>
    <th scope="col">还款日</th>
    <th scope="col">irr</th>
	<th scope="col">借款产品</th>
    <th scope="col">推荐比例</th>
    <th scope="col">推荐对价</th>
  </tr>
	<c:forEach items="${page.result}" var="item" varStatus="stauts">
		<c:choose>
  			<c:when test="${stauts.count%2==0}">
  				<tr class="ggkj_tdColr">
  			</c:when>
  			<c:otherwise>
  				<tr >
  			</c:otherwise>
		</c:choose>
			  <td>${stauts.count}</td>
			  <td>${item.loanId}</td>
			  <td>${item.sellOrderDtl.loanName}</td>
			  <td>${item.sellOrderDtl.ftTSellOrderMain.investInfo.customerInfo.cnName}</td>
			  <td><fmt:formatNumber value="${item.loanInfo.loanAMt}" pattern="##,###.##"/></td>
			  <td>${item.loanInfo.totalNum}</td>
			  <td>
			  	${item.loanInfo.loanOverDate} 
			  </td>
			  <td>${item.loanInfo.totalNum - item.loanInfo.currNum}</td>
			  <td>
			  <dictionary:display code="${item.ftOrderMain.investInfo.loanReturnDate}"/>
			  </td>
			  <td>${item.loanInfo.irr}</td>
			  <td><!-- 1001-随房贷,1002-随意贷,1003-随薪贷,1004-随车贷,1005-其他 -->
				<c:choose>
		  			<c:when test="${item.sellOrderDtl.loanCode==1001}">
		  				随房贷
		  			</c:when>
		  			<c:when test="${item.sellOrderDtl.loanCode==1002}">
		  				随意贷
		  			</c:when>
		  			<c:when test="${item.sellOrderDtl.loanCode==1003}">
		  				随薪贷
		  			</c:when>
		  			<c:when test="${item.sellOrderDtl.loanCode==1004}">
		  				随车贷
		  			</c:when>
		  			<c:when test="${item.sellOrderDtl.loanCode==1005}">
		  				其他
		  			</c:when>
				</c:choose>
			  </td>
			  <td>
			  <fmt:formatNumber value="${item.scale}" pattern="##,###.####" />
			  </td>
			  <td><fmt:formatNumber value="${item.amt}" pattern="##,###.##" /></td>
		  </tr>
	</c:forEach>
</table>
	
</div>
<div class="ggkj_pagecontainer">
  <div class="ggkj_pageBGleft">
    	<span class="ggkj_pageBGright"></span>
    	<a href="javascript:jumpPage(1)" class="ggkj_pageUpa">
        
        </a>
        <a href="javascript:jumpPage(${page.prePage})" class="ggkj_pageUp">
        
        </a>
        <span class="ggkj_insertline"></span>
        <span class="ggkj_pageSpan">
        	页<input type="text" id="pageNo" name="pageNo" class="ggkj_inputtext_30" value="${page.pageNo}">OF ${page.totalPages}
        </span>
        <span class="ggkj_insertline"></span>
        <a href="javascript:jumpPage(${page.nextPage})" class="ggkj_pageDown">
        
        </a>
        <a href="javascript:jumpPage(${page.totalPages})" class="ggkj_pageDowna">
        
        </a>
        <span class="ggkj_insertline"></span>
        
    </div>
</div>
<script language="JavaScript">
	function jumpPage(pageNo) {
		document.getElementById('pageNo').value=pageNo;
		document.getElementById('mainForm').submit();
	}
	function doSubmit(){
	var patrn=/[0-9]+[.[0-9]+]?/;
	var irrMin=document.getElementById("irrMin");
	var irrMax=document.getElementById("irrMax");
	if(irrMin.value!=""){
		if (!patrn.test(irrMin.value)) {
			alert("收益率必须是正小数！");
			return ;
		}
	} 
	if(irrMax.value!=""){
		if (!patrn.test(irrMax.value)) {
			alert("收益率必须是正小数！");
			return ;
		}
	} 
		$("#pageNo").val(1);
		document.getElementById('mainForm').submit();
	}
</script>
<script language="JavaScript">
  function OpenMatchWindow()
  {
   	window.showModalDialog("${ctx}/fortune/transmatch",window,"dialogWidth:400px;status:no;dialogHeight:250px"); 
  }
</script>
<script language="JavaScript">
	$(function() {
		$(".date-pick" ).datepicker({
	      dateFormat:'yy-mm-dd',
	      selectOtherMonths:true,
	      changeYear: true
  		});
	});
</script>
</body>
</form:form>
</body>
</html>
